import 'dart:convert';

Media mediaFromJson(String str) => Media.fromJson(json.decode(str));

String mediaToJson(Media data) => json.encode(data.toJson());

class Media {
  String? name;
  String? thumbPath;
  String? path;
  String? dateTime;
  String? longitude;
  String? latitude;
  String? address;
  GalleryMode? galleryMode;

  Media({
    this.name,
    this.thumbPath,
    this.path,
    this.dateTime,
    this.longitude,
    this.latitude,
    this.address,
    this.galleryMode,
  });

  Media.fromJson(dynamic json) {
    name = json['name'];
    thumbPath = json['thumbPath'];
    path = json['path'];
    dateTime = json['dateTime'];
    longitude = json['longitude'];
    latitude = json['latitude'];
    address = json['address'];
    galleryMode = json['galleryMode'];
  }

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['name'] = name;
    map['thumbPath'] = thumbPath;
    map['path'] = path;
    map['dateTime'] = dateTime;
    map['longitude'] = longitude;
    map['latitude'] = latitude;
    map['address'] = address;
    map['galleryMode'] = galleryMode;
    return map;
  }
}

enum GalleryMode {
  ///选择图片
  image,

  ///选择视频
  video,

  ///全部选择
  all,
}
